package cn.labbook.bluetooth.util;

import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class JsonUtils {

    public static Map<String,Object> getMapFromJson(String jsonString) {

        JSONObject jsonObject = JSONObject.parseObject(jsonString);
        Map<String,Object> map = new HashMap<>();
        Set<Map.Entry<String, Object>> iter = jsonObject.entrySet();
        for (Map.Entry<String, Object> entry : iter) {
            map.put(entry.getKey(),entry.getValue()) ;
        }

        return map;
    }
}
